Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: whitelist new options for NODE_OPTIONS #13002

Merged
merged 1 commit into from
May 17, 2017

Conversation

sam-github
Copy link
Contributor

@sam-github sam-github commented May 12, 2017

Add --inspect-port, --napi-modules, --trace-event-categories

Remove --prof-process, like -p and -e, it causes node to do something
other than run node js scripts.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

src

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label May 12, 2017
@sam-github
Copy link
Contributor Author

@@ -411,14 +411,18 @@ Node options that are allowed are:
- `--enable-fips`
- `--force-fips`
- `--icu-data-dir`
- `--inspect-brk`
Copy link
Contributor

@refack refack May 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must have had a reason to leave those out on the first run?
They will make a very weird effect...
inspect-port on the other hand is benign if used alone.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useful when running node via a shell script, and wanting to cause node when it runs to break on first line. I'm not sure how much thought went into this initially. I can leave only the -port if that's preferred.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ±0 on these.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I'll give it a couple days to see if anyone feels strongly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems useful to have, although if the node process spawns a child will that child also try to connect to the inspector?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, so don't do that unless the port is 0

@refack
Copy link
Contributor

refack commented May 12, 2017

Ignore the fail on macOS (and maybe freeBSD) they are flakes #12964 (comment)

@mscdex mscdex added the cli Issues and PRs related to the Node.js command line interface. label May 13, 2017
@Trott
Copy link
Member

Trott commented May 14, 2017

No idea if it would be difficult to accomplish or not, but a test for #12941 (assuming this fixes that issue) would be great.

Or at least some kind of test for the functionality change here?

@sam-github
Copy link
Contributor Author

@Trott #12941 is a different bug, something is wrong in the cluster pre-fork arg parsing, unrelated (though perhaps this could be used as work-around)

@refack
Copy link
Contributor

refack commented May 16, 2017

If this lands before #12949 I can add tests for --inspect, --inspect-brk, and --inspect-port

@sam-github
Copy link
Contributor Author

I removed support for --inspect, --inspect-brk, adding unit tests for every option passed via env var is a bit more than I can manage. I might remove support for --trace-event-categories as well, node has the unfortunate habit of randomly requiring either a = or a before an option's value :-(, but I'm trying harder for it because trace events are absolutely the kind of thing I'd want to configure via env var.

@sam-github sam-github force-pushed the add-inspect-to-node-options branch 2 times, most recently from 39ccc51 to 2472f17 Compare May 16, 2017 21:52
Copy link
Contributor

@refack refack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit

doc/api/cli.md Outdated
@@ -411,14 +411,16 @@ Node options that are allowed are:
- `--enable-fips`
- `--force-fips`
- `--icu-data-dir`
- `--inspect`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"--inspect-port"

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sam-github sam-github force-pushed the add-inspect-to-node-options branch from d6ce121 to 42d7e61 Compare May 17, 2017 17:11
@sam-github
Copy link
Contributor Author

@sam-github
Copy link
Contributor Author

Only failure was unrelated, sequential/test-net-connect-local-error on one of the FreeBSDs, I'm going to land this.

Add --inspect-*, --napi-modules, --trace-event-categories

Remove --prof-process, like -p and -e, it causes node to do something
other than run node js scripts.

PR-URL: nodejs#13002
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@sam-github sam-github force-pushed the add-inspect-to-node-options branch from 42d7e61 to d6cd466 Compare May 17, 2017 19:40
@sam-github sam-github merged commit d6cd466 into nodejs:master May 17, 2017
@sam-github sam-github deleted the add-inspect-to-node-options branch May 17, 2017 19:42
anchnk pushed a commit to anchnk/node that referenced this pull request May 19, 2017
Add --inspect-*, --napi-modules, --trace-event-categories

Remove --prof-process, like -p and -e, it causes node to do something
other than run node js scripts.

PR-URL: nodejs#13002
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@jasnell jasnell mentioned this pull request May 28, 2017
@sam-github
Copy link
Contributor Author

See #12677

@MylesBorins
Copy link
Contributor

I've added don't land for v6.x

If any of these flags should be backported please feel free to open a separate PR

@sam-github
Copy link
Contributor Author

backported in #12677

sam-github added a commit to sam-github/node that referenced this pull request Oct 11, 2017
Add --debug-*, --napi-modules

Remove --prof-process, like -p and -e, it causes node to do something
other than run node js scripts.

PR-URL: nodejs#13002
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
MylesBorins pushed a commit that referenced this pull request Oct 16, 2017
Add --debug-*, --napi-modules

Remove --prof-process, like -p and -e, it causes node to do something
other than run node js scripts.

Backport-PR-URL: #12677
PR-URL: #13002
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@MylesBorins MylesBorins mentioned this pull request Oct 17, 2017
MylesBorins pushed a commit that referenced this pull request Oct 25, 2017
Add --debug-*, --napi-modules

Remove --prof-process, like -p and -e, it causes node to do something
other than run node js scripts.

Backport-PR-URL: #12677
PR-URL: #13002
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@MylesBorins MylesBorins mentioned this pull request Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. cli Issues and PRs related to the Node.js command line interface.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants